package cjyyp.day02;

import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.locks.LockSupport;

@Slf4j
public class park_unpark {
    public static void main(String[] args) throws InterruptedException {
        Thread t=new Thread(new Runnable() {
            @Override
            public void run() {
                log.debug("t线程启动");
                log.debug("park");
                Thread thread = Thread.currentThread();
                LockSupport.park(thread);
                log.debug("unpark");
            }
        });
        t.start();
        Thread.sleep(2000L);
        LockSupport.unpark(t);
    }
}
